package com.bweab.pojo;

import java.sql.Timestamp;
import java.util.Objects;


/**
 *  充值记录实体类
 *
 *
 * */
public class DepositTb {
    private int depositId;//水电费充值记录id
    private int userId;//用户id
    private int dormitoryId;//宿舍id
    private int depositMonkey;//充值的钱数
    private Timestamp depositTime;//充值时间

    //无参构造
    public DepositTb() {
    }

    //有参构造

    public DepositTb(int depositId, int userId, int dormitoryId, int depositMonkey, Timestamp depositTime) {
        this.depositId = depositId;
        this.userId = userId;
        this.dormitoryId = dormitoryId;
        this.depositMonkey = depositMonkey;
        this.depositTime = depositTime;
    }

    /*
     *
     * getter setter 方法
     *
     * */

    public int getDepositId() {
        return depositId;
    }

    public void setDepositId(int depositId) {
        this.depositId = depositId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public int getDormitoryId() {
        return dormitoryId;
    }

    public void setDormitoryId(int dormitoryId) {
        this.dormitoryId = dormitoryId;
    }

    public int getDepositMonkey() {
        return depositMonkey;
    }

    public void setDepositMonkey(int depositMonkey) {
        this.depositMonkey = depositMonkey;
    }

    public Timestamp getDepositTime() {
        return depositTime;
    }

    public void setDepositTime(Timestamp depositTime) {
        this.depositTime = depositTime;
    }


    @Override
    public String toString() {
        return "DepositTb{" +
                "depositId=" + depositId +
                ", userId=" + userId +
                ", dormitoryId=" + dormitoryId +
                ", depositMonkey=" + depositMonkey +
                ", depositTime=" + depositTime +
                '}';
    }

    //equals 和 hashCode重写
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DepositTb depositTb = (DepositTb) o;
        return depositId == depositTb.depositId && userId == depositTb.userId && dormitoryId == depositTb.dormitoryId && depositMonkey == depositTb.depositMonkey && Objects.equals(depositTime, depositTb.depositTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(depositId, userId, dormitoryId, depositMonkey, depositTime);
    }
}
